<form id="form_{{ hash }}" action="{{ url }}" method="post">
    <span class="formtitle">{{ title }}</span>
    {{ form.as_p }}
    <input type="button" value="{{ submit|default:"提交" }}" onclick="$('#success_{{ hash }}').html('请等待...');
            var options={success: function(data){$('#form_{{ hash }}').parent().html(data);},
            error: function(data){alert(data.responseText);}}; 
            $('#form_{{ hash }}').ajaxSubmit(options);" />
<!--
<input type="button" value="{{ submit|default:"提交" }}" onclick="$('#form_{{ hash }}').ajaxSubmit(function(data){$('#form_{{ hash }}').parent().html(data);});" />
-->
    <input type="button" value="刷新表单" onclick="$('#form_{{ hash }}').parent().load('{{ url }}')" />
    <input type="button" value="清空表单" onclick="$('#form_{{ hash }}').clearForm()" />
    <span id="success_{{ hash }}" class="success">{% if not form.errors and form.is_bound %}{{ success_msg|default:"成功" }}{% endif %}</span>
</form>
